package com.training.java.core.collections.car.post15;

import java.util.Set;
import java.util.TreeSet;

import com.training.java.core.collections.car.post15.Car;

public class CarTreeSetDemo {

	public static void main(String[] args) {

		Car ford = new Car("Ford", "Focus", 2014, 12000);
		Car toyota = new Car("Toyota", "Corola", 2013, 18000);
		Car honda = new Car("Honda", "Civic", 2014, 18000);
		Car ford2 = new Car("Ford", "Focus", 2014, 12000);
		Car toyota2 = new Car("Toyota", "Camry", 2013, 18000);
		
		Set<Car> cars = new TreeSet<Car>();
		
		cars.add(ford);
		cars.add(toyota);
		cars.add(honda);
		cars.add(ford2);
		cars.add(toyota2);
		
		for(Car acar: cars)
		{
			System.out.println("Make of the car is " + acar.getMake());
			System.out.println("Model of the car is " + acar.getModel());
			System.out.println("Year of the car is " + acar.getYear());
			System.out.println("Price of the car is " + acar.getPrice());
			System.out.println("************");
		}
	}

}
